package com.ucl.model.entity.supplier;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.ucl.common.validator.FieldRepeatValidator;
import com.ucl.model.entity.base.BaseEntity;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName("supplier")
@FieldRepeatValidator(field = "name", message = "名称重复，请重新输入名称！")
public class Supplier extends BaseEntity<Supplier> {

    @TableId(value="id", type= IdType.AUTO)
    private Integer id;
    @TableField("name")
    private String name;
    @TableField("url")
    private String url;
    @TableField("parent_id")
    private Integer parentId;
    @TableField("is_delete")
    private Boolean delete;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
